<?php

/**
 * AplicacionBeca form base class.
 *
 * @method AplicacionBeca getObject() Returns the current form's model object
 *
 * @package    auip
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseAplicacionBecaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'beca_id'               => new sfWidgetFormInputHidden(),
      'usuario_id'            => new sfWidgetFormInputHidden(),
      'entidad_destino'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'add_empty' => true)),
      'actividades'           => new sfWidgetFormTextarea(),
      'informacion_adicional' => new sfWidgetFormTextarea(),
      'estado_actual'         => new sfWidgetFormTextarea(),
      'entrego_informe'       => new sfWidgetFormTextarea(),
      'fecha'                 => new sfWidgetFormDate(),
      'hora'                  => new sfWidgetFormTime(),
      'unidad_academica'      => new sfWidgetFormTextarea(),
      'fecha_comienzo'        => new sfWidgetFormDate(),
      'fecha_final'           => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'beca_id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('beca_id')), 'empty_value' => $this->getObject()->get('beca_id'), 'required' => false)),
      'usuario_id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('usuario_id')), 'empty_value' => $this->getObject()->get('usuario_id'), 'required' => false)),
      'entidad_destino'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Entidad'), 'required' => false)),
      'actividades'           => new sfValidatorString(array('required' => false)),
      'informacion_adicional' => new sfValidatorString(array('required' => false)),
      'estado_actual'         => new sfValidatorString(array('required' => false)),
      'entrego_informe'       => new sfValidatorString(array('required' => false)),
      'fecha'                 => new sfValidatorDate(array('required' => false)),
      'hora'                  => new sfValidatorTime(array('required' => false)),
      'unidad_academica'      => new sfValidatorString(array('required' => false)),
      'fecha_comienzo'        => new sfValidatorDate(array('required' => false)),
      'fecha_final'           => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('aplicacion_beca[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'AplicacionBeca';
  }

}
